package com.mapbar.ure.frontend.parser;

import com.mapbar.ure.ProductionType;

public class ParserState<T> {
	private int status;
	private ProductionType type;
	private Character value;
	private AST<T> ast;

	public int getStatus() {
		return status;
	}

	public ProductionType getType() {
		return type;
	}

	public ParserState(int status) {
		this.status = status;
		type = null;
	}

	public ParserState(ProductionType type, int status, AST<T> ast) {
		this.type = type;
		this.status = status;
		this.ast = ast;
	}

	@Override
	public String toString() {
		StringBuilder sb = new StringBuilder();
		sb.append(type);
		sb.append('\t');
		sb.append(status);
		sb.append('\n');
		return sb.toString();
	}

	public AST<T> getAST() {
		return ast;
	}

	public void setAst(AST<T> ast) {
		this.ast = ast;
	}

	public Character getValue() {
		return value;
	}

	public void setValue(Character value) {
		this.value = value;
	}

}
